package componentes;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class panelconfondo extends JPanel {

	ImageIcon  imagenFondo;
	String imagen;
	
	public panelconfondo(){

	}
	
	
	public void paintComponent(Graphics g){
     Dimension tamanio = getSize();
      imagenFondo = new ImageIcon(getClass().getResource(imagen));
	g.drawImage(imagenFondo.getImage(), 0, 0, tamanio.width, tamanio.height,null);
     setOpaque(false);	
		
     
     
     super.paintComponent(g);
	}
	
	
    public void setimagen(String img){
    	this.imagen = img;
    }
	
	
}
